#region History

/* -------------------------------------------------------------------------------- 
 * Project Name: JobBoard Enterprise
 * Module: Jb.Web 
 * Name: Address.cs
 * Purpose: ViewModel class for Address
 *                   
 * Author: Md. Hassanur Rahman
 * Language: C# SDK Version 4.0
 * --------------------------------------------------------------------------------
 * Change History:
 * Version: 1.0    MHR  05/20/2013
 * Description: Initial Development
 * -------------------------------------------------------------------------------- */

#endregion

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;


namespace Jb.Web.ViewModels
{
    [Serializable]
    
	public class AddressViewModel : BaseViewModel
	{	
        /// <summary>
		/// Gets or sets the ID
		/// </summary>
        public int ID { get; set;}
            
        [StringLength(1000, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Street Address")] 
		public String StreetAddress	{ get; set; }
            
        [Required(ErrorMessage= "Please Enter an Email")]
        [StringLength(150, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [DataType(DataType.EmailAddress)]
        [RegularExpression(@"\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*", ErrorMessage = "Please Enter a valid Email address")]
        [Display(Name = "Email")] 
		public String Email	{ get; set; }
            
        [StringLength(50, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Phone")] 
		public String Phone	{ get; set; }
            
        [StringLength(50, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Fax")] 
		public String Fax	{ get; set; }
            
        [Required(ErrorMessage= "Please Enter a Zip Code")]
        [StringLength(50, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [Display(Name = "Zip Code")] 
		public String ZipCode	{ get; set; }
            
        [StringLength(250, ErrorMessage = "The {0} can be maximum {1} characters long.")]
        [RegularExpression(@"(http://)?(www\.)?\w+\.(com|net|edu|org)(/?\w+)?", ErrorMessage = "Please Enter a valid Web Site address")]
        [Display(Name = "Web Site")]
        [DataType(DataType.Url)]
		public String WebSite	{ get; set; }
            
        [Required(ErrorMessage= "Please Enter a Address Type")]
        [Display(Name = "Address Type")] 
		public int AddressType	{ get; set; }

        [Required(ErrorMessage = "Please Select a Country")]
        //[Range(1, int.MaxValue, ErrorMessage = "Please Select a Country")]
        [Display(Name = "Country")]
        public int CountryID { get; set; }

        [Required(ErrorMessage = "Please Select a State")]
        //[Range(1, int.MaxValue, ErrorMessage = "Please Select a State")]
        [Display(Name = "State")]
        public int StateID { get; set; }

        [Required(ErrorMessage = "Please Select a City")]
        [Display(Name = "City")] 
        public int CityID { get; set;}

        //[Required(ErrorMessage= "Please Select a Modified By")] 
        [Display(Name = "Modified By")] 
        public int ModifiedBy { get; set;}
            
        //[Required(ErrorMessage= "Please Enter a Created On")]
        [Display(Name = "Created On")] 
		public String CreatedOn	{ get; set; }
            
        //[Required(ErrorMessage= "Please Enter a Modified On")]
        [Display(Name = "Modified On")] 
		public String ModifiedOn	{ get; set; }
	}

    public enum AddressType
    {
        Present = 1,
        Permanent = 2,
        Mailing = 3,
        Shipping = 4
    }
}

